# -*- encoding: utf-8 -*-
import time, datetime
from collections import defaultdict, OrderedDict
from operator import itemgetter
from itertools import groupby
import math
from odoo import models, fields, api, _, tools, SUPERUSER_ID

from odoo.tools import float_compare, float_round, float_is_zero
from odoo.exceptions import UserError, ValidationError
from odoo.addons import base_cw


class generate_profit_loss_voucher_wizard(models.TransientModel):
    _name = 'generate.profit.loss.voucher.wizard'
    _description = u'结转益损向导'

    period_id = fields.Many2one('account.period', u'期别', domain="[('gl_state','=','open')]")



    def action_confirm(self):
        self.ensure_one()
        self._cr.execute("""select create_profit_loss_voucher(%s,%s,%s) """ % (
        self.period_id.id, self.env.user.company_id.id, self._uid))
